(outline-heading-end-regexp): Fix typo.
authorRichard M. Stallman <rms@gnu.org>
Wed, 19 May 1993 16:19:00 +0000 (16:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 19 May 1993 16:19:00 +0000 (16:19 +0000)
(outline-minor-mode-map): New variable.
(minor-mode-map-alist): Add new entry.
(outline-minor-mode): Work with above change.
Do not set outline-regexp or outline-header-end-regexp.

lisp/textmodes/ooutline.el

index 19ee1f70b297b187bd735fcf2c238b52c211aa1a..7867652ea6226c7eb3957968fb623e7ea5d8eb8a 100644 (file)
@@ -36,7 +36,7 @@ Any line whose beginning matches this regexp is considered to start a heading.
 The recommended way to set this is with a Local Variables: list
 in the file it applies to.  See also outline-heading-end-regexp.")
   
-(defvar outline-heading-end-regexp "[\n^M]"
+(defvar outline-heading-end-regexp "[\n\^M]"
   "*Regular expression to match the end of a heading line.
 You can assume that point is at the beginning of a heading when this
 regexp is searched for.  The heading ends at the end of the match.
@@ -122,7 +122,19 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
                                   outline-regexp "\\)"))
   (run-hooks 'text-mode-hook 'outline-mode-hook))
 
-(defun outline-minor-mode (arg)
+(defvar outline-minor-mode-map nil)
+(if outline-minor-mode-map
+    nil
+  (setq outline-minor-mode-map (make-sparse-keymap))
+  (define-key outline-minor-mode-map "\C-c"
+    (lookup-key outline-mode-map "\C-c")))
+
+(or (assq 'outline-minor-mode minor-mode-map-alist)
+    (setq minor-mode-map-alist
+         (cons (cons 'outline-minor-mode outline-minor-mode-map)
+               minor-mode-map-alist)))
+
+(defun outline-minor-mode (&optional arg)
   (interactive "P")
   (setq outline-minor-mode
        (if (null arg) (not outline-minor-mode)
@@ -130,20 +142,8 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
   (if outline-minor-mode
       (progn
        (setq selective-display t)
-       (make-local-variable 'outline-old-map)
-       (setq outline-old-map (current-local-map))
-       (let ((new-map (copy-keymap outline-old-map)))
-         (define-key new-map "\C-c"
-           (lookup-key outline-mode-map "\C-c"))
-         (use-local-map new-map))
-       (make-local-variable 'outline-regexp)
-       (setq outline-regexp "[ \t]*/\\*")
-       (make-local-variable 'outline-heading-end-regexp)
-       (setq outline-heading-end-regexp "\\*/[^\n\^M]*[\n\^M]")
        (run-hooks 'outline-minor-mode-hook))
-    (progn
-      (setq selective-display nil)
-      (use-local-map outline-old-map))))
+    (setq selective-display nil)))
 \f
 (defun outline-level ()
   "Return the depth to which a statement is nested in the outline.
@@ -407,4 +407,6 @@ and return that position or nil if it cannot be found."
        nil
         (point))))
 
+(provide 'outline)
+
 ;;; outline.el ends here